/*
 * @Description:
 * @Author: kanglin
 * @Date: 2018-05-18
 * @Copyright: Created by Panxsoft.
 */


/* eslint-disable */
new Vue({
	el: '#navigation_list',
	data: function () {
		return {};
	},
	methods: {
		handleClick: function (event) {
			var items = [].slice.call(this.$el.children);
			for (var i=0; i < items.length; i++) {
				items[i].className = items[i].className.replace(/\s+?active/i, '');
			}
            event.currentTarget.className = event.currentTarget.className +' active';
        },
	},
});


new Vue({
	el: '#scenario',
	data: {

	},
	mounted() {
		// alert('sd')
	},
	methods: {
		handleMouseEnter(event) {
			var targetNode = event.target;
            var brotherNode = event.target.parentElement.children;
			for (var i = 0; i < brotherNode.length; i++) {
				brotherNode[i].className = brotherNode[i].className.replace(/\s+?active/, '');
			}
			targetNode.className = targetNode.className+ ' active';
		},
	},
});

new Vue({
	el: '#category',
	data() {
		return {};
	},

	methods: {
		/**
         *  根据索引值切换
         */
		switchPlane(index) {
			var planes = [].slice.call(this.$refs.content.children);
            var tabs = [].slice.call(this.$refs.tabs.children);
			for (var i = 0; i < planes.length; i++) {
				planes[i].className = planes[i].className.replace(/\s+?active/, '');
				tabs[i].className = tabs[i].className.replace(/\s+?active/, '');
			}
			planes[index].className = planes[index].className + ' active';
			tabs[index].className = tabs[index].className+ ' active';
		},
	},

});

new Vue({
	el: '#language_switch',
	methods: {
		/**
         *  设置中文
         */
		setChinese() {
			location.href = location.pathname+ '?lang=zh';
		},

		/**
         * 设置英文
         */
		setEnglish() {
			location.href = location.pathname+'?lang=en';
		},
	},
});

